/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author lzw
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';

const { ctxPath, adminPath } = useGlobSetting();

export interface FtdsDebtorManagement extends BasicModel<FtdsDebtorManagement> {
  managementSsjf?: string; // 所属甲方
  managementPtf?: string; // 平台方
  managementCzf?: string; // 处置方
  managementCzfs?: string; // 处置方式
  managementWarq?: string; // 委案日期
  managementZwrxm?: string; // 债务人姓名
  managementSfzhm?: string; // 身份证号码
  managementCsrq?: string; // 出生日期
  managementSjhm?: string; // 手机号码
  managementSfzdz?: string; // 身份证地址
  managementMz?: string; // 民族
  managementXb?: string; // 性别
  managementFy?: string; // 法院
  managementGzsl?: string; // 共债数量
  managementZyqbj?: string; // 总逾期本金
  managementZyqlx?: string; // 总逾期利息
  managementZyqfx?: string; // 总逾期罚息
  managementFzr?: string; // 负责人
  managementSfyxdd?: string; // 是否有新订单
  managementHkzt?: string; // 还款状态
  ftdsOrderList?: any[]; // 子表列表
}

export const ftdsDebtorManagementList = (params?: FtdsDebtorManagement | any) =>
  defHttp.get<FtdsDebtorManagement>({ url: adminPath + '/operating/ftdsDebtorManagement/list', params });

export const ftdsDebtorManagementListData = (params?: FtdsDebtorManagement | any) =>
  defHttp.post<Page<FtdsDebtorManagement>>({ url: adminPath + '/operating/ftdsDebtorManagement/listData', params });

export const ftdsDebtorManagementForm = (params?: FtdsDebtorManagement | any) =>
  defHttp.get<FtdsDebtorManagement>({ url: adminPath + '/operating/ftdsDebtorManagement/form', params });

export const ftdsDebtorManagementSave = (params?: any, data?: FtdsDebtorManagement | any) =>
  defHttp.postJson<FtdsDebtorManagement>({ url: adminPath + '/operating/ftdsDebtorManagement/save', params, data });

export const ftdsDebtorManagementImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/operating/ftdsDebtorManagement/importData',
      onUploadProgress,
    },
    params,
  );

export const ftdsDebtorManagementDelete = (params?: FtdsDebtorManagement | any) =>
  defHttp.get<FtdsDebtorManagement>({ url: adminPath + '/operating/ftdsDebtorManagement/delete', params });
